﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using GameCore;
using GameObject;
using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Audio;
using Microsoft.Xna.Framework.Content;
using Microsoft.Xna.Framework.GamerServices;
using Microsoft.Xna.Framework.Graphics;
using Microsoft.Xna.Framework.Input;
using Microsoft.Xna.Framework.Media;
using Microsoft.Xna.Framework.Net;
using Microsoft.Xna.Framework.Storage;

namespace ResourceManager
{
    public class IDManager
    {
        class Point_Game{ public Point id;public VisibleGameEntity game_obj;}

        static List<List<Point_Game>> l_GameID = new List<List<Point_Game>>();
        static List<Point> id_type =new List<Point>();
        static int id_count = 0;
        public static Point getID(int idx, VisibleGameEntity g_object)
        {
            if (idx <= -1)
            {
                Point_Game idg = new Point_Game();
                idg.id = new Point(l_GameID.Count, 0);
                idg.game_obj = g_object;
                List<Point_Game> lidg = new List<Point_Game>();
                lidg.Add(idg);
                l_GameID.Add(lidg);
                
                return idg.id;
            }

            if (idx <= l_GameID.Count)
            {
                Point_Game idg = new Point_Game();
                idg.id = new Point(idx, l_GameID[idx].Count);
                idg.game_obj = g_object;
                l_GameID[idx].Add(idg);
                return idg.id;
            }
            return new Point(-1,-1);
        }
    }
}
